{% extends 'base.html'%}

{% block content %}
<style>
    .header-ul li a {
        color: gray;
    }
    body::-webkit-scrollbar { width: 10px !important }
</style>

    <div class="wrapper">
        <div class="perch"></div>
        <div class="book_con">
            <div class="wrap">
                <div class="slot">
                    <ul>
                        <li><a href="/">首页</a></li>
                        <li> &nbsp;->&nbsp; </li>
                        <li class="book-type"><a href="/morebook?tp={{book['type']}}">{{book['type']}}</a></li>
                        <li> &nbsp;->&nbsp; </li>
                        <li><a href="/">{{book['name']}}</a></li>
                    </ul>
                </div>
                <div>
                    <div class="cover">
                        <img src="/static/img/cover.jpg">
                    </div>
                    <div class="bookinfo">
                        <h2>{{book['name']}}</h2>
                        <p class="author">作者： {{book['author']}}</p>
                        <ul>
                            <li>操作：</li>
                            <li>
                                {% if book['down_url'] != None %}
                                <a href="{{book['down_url']}}"><small>下载</small></a>
                                {% else %}
                                <a  href="/down/{{book['id']}}"><small>下载</small></a>
                                {% endif %}
                            </li>
                            {% if book['isct'] %}
                            <li><a tag="{{book['id']}}" class="poin_after"><small>已收藏</small></a></li>
                            {% else %}
                            <li><a tag="{{book['id']}}" class="collect"><small>收藏</small></a></li>
                            {% endif %}
                            <li><a href="#"><small>报错</small></a></li>
                        </ul>
                    </div>
                    <div class="desc">
                        {{book['desc']}}
                    </div>

                    <!-- 如果有度过此书，就显示上次阅读章节 -->
                    <div class="progress">上次阅读到：</div>
                </div>
            </div>
        
            <div class="list">
                <dl>
                    <dt>《{{book['name']}}》正文</dt>
                    {% for sec in book['secs'] %}
                        <dd><a href="/read/{{ book['id']}}/{{ sec['href'] }}">{{ sec['title'] }}</a></dd>
                    {% endfor %}
                </dl>
            </div>
        </div> 
    </div>

{% endblock %}